﻿using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Web.Http;
using Inovout.Cloud.Messager.Domain;
using Inovout.Data.Service;
using Inovout.Web.Http;

namespace Inovout.Cloud.Messager.WebApi.Controllers
{
    public class MessageController : BaseController
    {
        [Route("v1/m")]
        public IEnumerable<IMessage> Get()
        {
            return new Message[] { new Message { BodyContent = "123" } };
        }
        [Route("v1/m")]
        public IMessage Post(IMessage message)
        {
           GetService<IRepositoryService<Message>>().Save(message as Message);
            return message;
        }
    }
}
